package com.igoal.campaign.xmas2010.dto;

import java.io.Serializable;

import com.igoal.campaign.xmas2010.entity.Xmas2010;
import com.igoal.dto.BaseDTO;
import com.igoal.entity.User;
import com.igoal.utils.SynchronizeAttributeWithOther;
import com.igoal.utils.SynchronizeDirection;

public class XmasWishDTO extends BaseDTO<Xmas2010> implements Serializable {

	private static final long serialVersionUID = -5151626155763021442L;

	private String ownerName;
	private String wish;
	private String imgUrl;
	private String videoUrl;

	public String getOwnerName() {
		return ownerName;
	}

	public void setOwnerName(String owner) {
		this.ownerName = owner;
	}

	public String getWish() {
		return wish;
	}

	public void setWish(String wish) {
		this.wish = wish;
	}

	public String getImgUrl() {
		return imgUrl;
	}

	public void setImgUrl(String imgUrl) {
		this.imgUrl = imgUrl;
	}

	public String getVideoUrl() {
		return videoUrl;
	}

	public void setVideoUrl(String videoUrl) {
		this.videoUrl = videoUrl;
	}

	@SynchronizeAttributeWithOther(direction = SynchronizeDirection.FROM, value = "owner")
	public void initOwner(Object entity) {
		if (entity != null && entity instanceof User) {
			User u = (User) entity;
			ownerName = u.getUsername();
		}
	}
}
